<template>
	<div>
		<router-link to="/">返回上一页</router-link>
		<div class="from">
			<h3>出发城市：{{fromInfo.city_name}}</h3>
			<p>{{fromInfo.high_in_desc}}</p>
			<p>{{fromInfo.low_in_desc}}</p>
		</div>
		<hr>
		<div class="to">
			<h3>到达城市：{{toInfo.city_name}}</h3>
			<p>{{toInfo.high_in_desc}}</p>
			<p>{{toInfo.low_in_desc}}</p>
		</div>
	</div>
</template>

<script>
	import api from "../api";
	export default {
		name: "Policy",
		data() {
			return {
				fromInfo: {},
				toInfo: {}
			}
		},
		props: {
			citys: {
				type: Array,
				default: function() {
					return [];
				}
			}
		},
		mounted() {
			console.log(this.citys);
			console.log(this.$route.query);
			api.getCitypoliceData({
				token: "xB3VkF4e5ul2ah50",
				from: this.$route.query.citys[0].value,
				to: this.$route.query.citys[1].value,
			}).then(res => {
				console.log(res);
				this.fromInfo = res.data.data.from_info;
				this.toInfo = res.data.data.to_info;
			}).catch(error => {
				console.log(error);
			})
		},
	}
</script>

<style>
</style>
